65726b6fa5f04685bf4e912fad917ee8298f72d2,spring-cloud-deployer-resource-support/src/test/java/org/springframework/cloud/deployer/resource/registry/UriRegistryPopulatorTests.java,UriRegistryPopulatorTests,populateRegistryInvalidUri,#,90

Before Change


		UriRegistryPopulator.populateRegistry(true, registry, new PropertiesResource(props));
		assertThat(registry.findAll().size(), is(1));
		assertThat(registry.find("test").toString(), is("file:///bar-1.2.3.jar"));
		UriRegistryPopulator.populateRegistry(true, registry, new PropertiesResource(props));
		props.setProperty("test", "invalid");
		UriRegistryPopulator.populateRegistry(true, registry, new PropertiesResource(props));
		assertThat(registry.find("test").toString(), is("file:///bar-1.2.3.jar"));

After Change



	@Test
	public void populateRegistryInvalidUri() throws Exception {
		String localUri = "local://local";
		Properties props = new Properties();
		props.setProperty("test", "file:///bar-1.2.3.jar");
		UriRegistryPopulator populator = new UriRegistryPopulator();
		StubResourceLoader resourceLoader = new StubResourceLoader(new PropertiesResource(props));
		populator.setResourceLoader(resourceLoader);
		UriRegistry registry = new InMemoryUriRegistry();
		populator.populateRegistry(true, registry, localUri);
		assertTrue(resourceLoader.getRequestedLocations().contains(localUri));
		assertThat(resourceLoader.getRequestedLocations().size(), is(1));
		assertThat(registry.findAll().size(), is(1));